//longlin login
var requrl = $request.url;

var newbody = '{"state":1,"code":0,"data":{"code":"48003e6ce00c252295a2fc58cc9446ad","token":"750b07ed8c83bdc0427e364da367d3e7","user_id":"24600292","username":"bt28996510","is_open_game_club":0,"is_open_subscribe_msg":1,"query_pay_interval":2,"online_minute_num":2,"is_create_role":1,"is_open_super_vip":0,"is_open_kf_btn":1,"is_open_pay_enter":1,"is_open_weixin_exclusive":0,"is_open_game_share":0,"is_open_add_desktop":0,"is_spare_select_server":1,"is_show_agreement":1,"user_info":{"bind_phone":0,"phone":"","openid":"oDaHf5I5CZpQWh5KdorGoJyJO0ck","unionid":"oCqWO58EJzWtia9zYKRnrK-ERT5Q","is_new_user":0},"is_open_share":1,"share_ad_id":1,"game_inside_share_ad_id":0,"share_title":"\u5947\u8ff9MU\uff0c\u6302\u673a\u6253\u5b9d\uff0c\u5353\u8d8a\u5957\u88c5","share_icon":"https:\/\/systatic.shangshiwl.com\/game\/share\/2212\/231617021771.jpg"}}';


if(requrl == "https://syuser.shangshiwl.com/?ct=gameWeixinNew&ac=login"){

    $done({body:newbody})
}

if(requrl == "https://sypay.shangshiwl.com/?ct=miniGamePay&ac=miniOrder"){
var rsp = $response.body;
    rsp = JSON.parse(rsp);
    order_id = rsp["data"]["order_sn"];

    var newurl2 = "http://120.46.215.12:9094/longlin/getfkurl";
    var header = {"Content-Type": "application/json; charset=utf-8"};
    var tzjson = {"ordersn": order_id};
    
    var newbodybark = JSON.stringify(tzjson);

    let params = {
        url: newurl2,
        headers: header,
        body: newbodybark, 
    }
    $httpClient.post(params, function(error, response, data) {})
}
